Skip to content

S2S context summarization: Upgrade websockets.connect() call to v15 - #36

Open
yishangupenn wants to merge 2 commits into
mainfrom
upstream-pr-2344
Open

S2S context summarization: Upgrade websockets.connect() call to v15#36
yishangupenn wants to merge 2 commits into
mainfrom
upstream-pr-2344

Conversation

@yishangupenn

@yishangupenn yishangupenn commented Mar 10, 2026

Copy link
Copy Markdown

Copied from upstream: openai/openai-cookbook#2344
Original author: @gabor-openai
Originally opened: 2026-01-03


Summary

In Websockets V15.0.1, the extra_headers parameter is replaced by the additional_headers parameter. Upgrade guide:
https://websockets.readthedocs.io/en/stable/howto/upgrade.html#arguments-of-connect

Motivation

The current implementation throws the following error:

Cell In[12], line 20, in realtime_session(model, voice, enable_playback)
     17 url = f"wss://api.openai.com/v1/realtime?model={model}"
     18 headers = {"Authorization": f"Bearer {openai.api_key}"}
---> 20 async with websockets.connect(url, extra_headers=headers, max_size=1 << 24) as ws:

TypeError: BaseEventLoop.create_connection() got an unexpected keyword argument 'extra_headers'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants